﻿using BySoft.Server.Common;
using BySoft.Server.Common.Entity;
using BySoft.Server.DataAccess;
using BySoft.Server.DataAccess.UserCode;
using OneSoft.DataAccess;
using OneSoft.EntityCore;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace BySoft.Server.Business
{
    public partial class BsProductinstock
    {

        public static bool CheckExist(string ProductinstockIDValue)
        {

            return ClsComm.CheckExist("BS_Productinstock", "BillID", ProductinstockIDValue, true);
           
        }
        public static bool CheckUsed(string BillIDValue)
        {

            bool result = false;
            return result;

        }
        public static bool SaveOrUpdate(BsProductinstockEntity entity,  bool isNew)
        {
            return BsProductinstockDA.SaveOrUpdate(entity,  isNew);
        }

        public static bool Del(string strCode)
        {
            return BsProductinstockDA.Del(strCode);
        }

        public static DataTable SelectList(string strBillID, string strProductID, string strWorkOrderNo, string strFrom, string strEnd, int pageIndex, int PageSize, out int m_count)
        {
            return BsProductinstockDA.SelectList(strBillID, strProductID, strWorkOrderNo, strFrom, strEnd, pageIndex, PageSize, out m_count);
        }

        public static DataTable SelectDialogList(string strCurrentID, string strProductID,string strProductName,
            string strOrderID, string strWorkOrderNo, string strScheduleID, int pageIndex, int PageSize, out int m_count)
        {


            return BsProductinstockDA.SelectDialogList(strCurrentID, strProductID,strProductName,strOrderID, strWorkOrderNo,strScheduleID, pageIndex, PageSize, out  m_count);
        }

        public static DataTable SelectDialogList(string strCurrentID, string strProductID,
            string strWorkOrderNo, string strScheduleID)
        {
            int pageIndex = 0;
            int PageSize = 100;
            int m_count = 0;

            return BsProductinstockDA.SelectDialogList(strCurrentID, strProductID, null, null, strWorkOrderNo, strScheduleID, pageIndex, PageSize, out  m_count);
        }
           public static DataTable SelectHeadData(string strBillID)
           {
               return BsProductinstockDA.SelectHeadData(strBillID);
           }
         


         
           public static DataTable CreateDT()
           {
               return SelectHeadData("-1");
           }


    }
}
